package cn.edu.cqupt.cxcy.action;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.edu.cqupt.cxcy.dao.AdminDao;
import cn.edu.cqupt.cxcy.dto.AdminImpl;

/**
 * 管理员后台主页
 * @author Dancer-mno
 * @date 2015年10月17日
 */
public class AdminIndex extends HttpServlet {
	private static final long serialVersionUID = 1L;
	
	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		this.doPost(request, response);
	}
	
	@Override
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.setCharacterEncoding("utf-8");
		AdminDao admin = new AdminImpl();
		int cdyy = admin.pointCdyy();
		int pro  = admin.pointPro();
		request.setAttribute("cdyy", cdyy);
		request.setAttribute("pro", pro);
		request.getRequestDispatcher("manager.jsp").forward(request, response);
	}

}
